<?php
    $this->title = $title;
?>


<div class="weui_media_box weui_media_text">
        <h4 class="weui_media_title" align="center">会员特权</h4>
        <p class="weui_media_desc">
        	一系列置顶特权，超值优惠，多买多送，优惠多多
        </p>
</div>
<br/>
<div class="weui_cells weui_cells_form">
    <div class="weui_cell">
        <div class="weui_cell_hd"><label class="weui_label" for="">姓名</label></div>
        <div class="weui_cell_bd weui_cell_primary">
            <input name="username" type="text" value="" class="weui_input" maxlength=4 placeholder="请输入姓名">
        </div>
    </div>
    <div class="weui_cell">
        <div class="weui_cell_hd"><label class="weui_label" for="">手机</label></div>
        <div class="weui_cell_bd weui_cell_primary">
            <input name="phone" type="number" placeholder="目前只支持国内手机号" value="" class="weui_input" pattern="[0-9]*">
        </div>
    </div>
    <div class="weui_cell weui_cell_select weui_select_after">
            <div class="weui_cell_hd">
                <label class="weui_label" for="">数量</label>
            </div>
            <div class="weui_cell_bd weui_cell_primary">
                <select name="buycount" class="weui_select">
                    <option value="1">1个月(10元)</option>
                    <option value="2">2个月(20元)</option>
                    <option value="3">3个月(25元)</option>
                    <option value="6">半年(50元)</option>
                    <option value="12">1年(80元)</option>
                </select>
            </div>
    </div>
    <div class="weui_cells weui_cells_checkbox">
        <label for="s11" class="weui_cell weui_check_label">
            <div class="weui_cell_hd">
                <input type="radio" id="s11" name="agree" class="weui_check">
                <i class="weui_icon_checked"></i>
            </div>
            <div class="weui_cell_bd weui_cell_primary">
                <p>已阅读并同意xxx和xxx, 并遵循规则，以平台公告为准</p>
            </div>
        </label>
    </div>

    <div class="weui_btn_area">
        <a id="buyBtn" href="javascript:" class="weui_btn weui_btn_primary">立即购买</a>
    </div>
</div>


<script type="text/javascript" src="//cdn.bootcss.com/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript">
    $('#buyBtn').click(function(){
    	$.post(
    		'/orders/create',
    		{'username': $('input[name="username"]').val(), 'phone': $('input[name="phone"]').val(), 'count': $('select.weui_select').val()},
    		function(res) {
    			window.location.href = '/orders/pay?order_id='+res;
    		})
    })
</script>